<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>物品列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="<%=path%>/lib/bootstrap/css/bootstrap.min.css" />
	<script type="text/javascript" src="<%=path%>/lib/jquery-1.8.1.min.js"></script>
	<script type="text/javascript" src="<%=path%>/lib/bootstrap/js/bootstrap.min.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/xcConfirm.css"/>
	<script src="<%=path%>/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>

  </head>
  
  <body>
    <h2 style="padding: 3%;">房间物品列表</h2>
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
			<input type="text" class="search-query" name="" placeholder="输入物品类型 / 物品名称" style="height: 3%;"/>
			
			<input type="button" class="btn btn-primary" name="" value="查询"/>
			<input type="button" class="btn btn-success" name="" value="物品添加"/>
				<table class="table table-hover">
					<thead>
						<tr>
							<th>编号</th>
							<th>物品</th>
							<th>物品名称</th>
							<th>物品价格</th>
							<th>类型</th>
							<th>备注</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${goods}" var="goo" varStatus="col">
							<tr class="${col.count%2==0?'':'info' }">
								<td>${goo.goodsId }</td>
								<td>${goo.goodid }</td>
								<td>${goo.goodname }</td>
								<td>${goo.gooodprice }</td>
								<td>${goo.purpose }</td>
								<td>${goo.remark }</td>
									<td >
										<a  class="btn btn-warning update" onclick="getId(${goo.goodsId})">修改</a>
										<button class="btn btn-danger delete" id="delete${goo.goodsId}">删除</button>
									</td>
								
							</tr>
						</c:forEach>
					</tbody>
				</table>
				
					 <ul class="pager">
						  <li class="previous ${pageNo==1?'disabled':''}">
							  <c:if test="${pageNo==1}">
							  	<a>上一页</a>
							  </c:if>
							  <c:if test="${pageNo!=1}">
							  	<a href="goodsList.action?pageNo=${pageNo-1 }">上一页</a>
							  </c:if>
						  </li>
						  
						  <li style="text-align: center;">${pageNo}</li>
						  
						  <li class="next ${goods.size()%pageSize!=0?'disabled':''}">
							  <c:if test="${goods.size()%pageSize!=0}">
							  		<a>下一页</a>
							  </c:if>
							  <c:if test="${goods.size()%pageSize==0}">
							  		<a href="goodsList.action?pageNo=${pageNo+1 }">下一页</a>
							  </c:if>
						  </li>
						  
						  <!-- previous disabled显示禁用 -->
					</ul> 
				
			</div>
		</div>
	</div>
	<div class="" style="height: 768px;"></div>
		<script src="js/canvas-nest.min.js" count="200" zindex="-2" opacity="0.5" color="47,135,193" type="text/javascript"></script>
  </body>
</html>
